package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AWareJlMapper;
import com.ruoyi.system.domain.AWareJl;
import com.ruoyi.system.service.IAWareJlService;

/**
 * 浆料配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-15
 */
@Service
public class AWareJlServiceImpl implements IAWareJlService 
{
    @Autowired
    private AWareJlMapper aWareJlMapper;

    /**
     * 查询浆料配置
     * 
     * @param id 浆料配置主键
     * @return 浆料配置
     */
    @Override
    public AWareJl selectAWareJlById(Long id)
    {
        return aWareJlMapper.selectAWareJlById(id);
    }

    /**
     * 查询浆料配置列表
     * 
     * @param aWareJl 浆料配置
     * @return 浆料配置
     */
    @Override
    public List<AWareJl> selectAWareJlList(AWareJl aWareJl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareJl.setGroupId(deptId.toString());
        return aWareJlMapper.selectAWareJlList(aWareJl);
    }

    /**
     * 新增浆料配置
     * 
     * @param aWareJl 浆料配置
     * @return 结果
     */
    @Override
    public int insertAWareJl(AWareJl aWareJl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareJl.setGroupId(deptId.toString());
        return aWareJlMapper.insertAWareJl(aWareJl);
    }

    /**
     * 修改浆料配置
     * 
     * @param aWareJl 浆料配置
     * @return 结果
     */
    @Override
    public int updateAWareJl(AWareJl aWareJl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareJl.setGroupId(deptId.toString());
        return aWareJlMapper.updateAWareJl(aWareJl);
    }

    /**
     * 批量删除浆料配置
     * 
     * @param ids 需要删除的浆料配置主键
     * @return 结果
     */
    @Override
    public int deleteAWareJlByIds(Long[] ids)
    {
        return aWareJlMapper.deleteAWareJlByIds(ids);
    }

    /**
     * 删除浆料配置信息
     * 
     * @param id 浆料配置主键
     * @return 结果
     */
    @Override
    public int deleteAWareJlById(Long id)
    {
        return aWareJlMapper.deleteAWareJlById(id);
    }
}
